﻿using CommandLine;
using CommandLine.Text;
using log4net;
using System;
using System.Threading.Tasks;
using Zbus.Mq;

namespace Zbus.Examples
{  
    class ConsumerExample
    { 

        static void Main(string[] args)
        { 
            Broker broker = new Broker("localhost:15555;localhost:15556");
            var ctrl = new Message();
            ctrl.Topic = "MyTopic";
            ctrl.ConsumeGroup = "MyTopic"; 
       
            Consumer c = new Consumer(broker, ctrl); 
            c.ConnectionCount = 1; 
            c.MessageHandler += (msg, client) => {
                Console.WriteLine(msg); 
            };
            c.Start();

            Console.ReadKey();
        }
    }
}
